{	Problem: http://codeforces.ru/problemset/problem/80/B
	Verdict: Accepted
}
uses SysUtils;
var a,b:longint; rh,rm,d:double; s:String;
begin
readln(s);
a:=strtoint(copy(s,1,2));
b:=strtoint(copy(s,4,2));
a:=a mod 12;
rm:=b*6;
rh:=a*30;
d:=b/60;
rh:=rh+30*d;
write(rh:0:9,' ',rm:0:9);
end.